/*
 * ICG SRL - International Consulting Group 2011
 */
package org.heyma.core.dao;

import com.icg.entityclassutils.Entity;
import java.io.Serializable;
import java.text.ParseException;
import java.util.List;
import java.util.Map;

/**
 *
 * @author Johnston Castillo Valencia
 * email: john.gnu@gmail.com
 * @since 01-03-2011
 */
public interface Dao {

    public void persist(Object entity);

    public void persist(Object[] entities);

    public void remove(Object entity);

    public <T> List<T> find(Class<T> entityClass);

    public <T> T load(Class<T> entityClass, Serializable id);

    public <T> T get(Class<T> entityClass, Serializable id);

    public <T> List<T> find(String hql);

    public <T> List<T> pagination(Class<T> entityClass, int start, int limit);

    public void execute(String sql);
    
    public void persist(String SQL, Map<String, Object> values);
    
    public boolean existTable(String schema, String tablename);

    public <T> List<T> selectSQL(String SQL);
    
    public <T> List<T> selectSQLRW(String SQL);

//    public <T> List<T> selectSQLMapResult(String SQL);

    public <T> List<T> selectSQL(Class<T> javaClass, String SQL);

    public <T> List<T> selectSQL(String SQL, Map values);

    public List<Map<String, Object>> find(Entity entity, Long parent_id);

    public Map<String, Object> get(Entity entity, Long id);

    public void remove(String SQL, Long id);

    public void selectSQLDelMapResult(String SQL, String id);

    public void update(String SQL, Map<String, String> tableMap, Map<String, Object> insertable);
    @Deprecated
    public void persist(Entity entity, Map<String, Object> objectMap, Entity parrent) throws ParseException;
    @Deprecated
    public Map<String, Object> getObjetPredio(Entity predio, long id);
    @Deprecated
    public Map<String, Object> getObjetManzana(Entity manzana, long id);

    public void persist(String SQL, Object[] values);
    @Deprecated
    public Map<String, Object> getObjetFicha(long id);

    public List<Map<String, Object>> getFichas(String predioid);

    // public List<Map<String, Object>> getFichasControl(String predioid);
    public List<Map<String, Object>> getParametrosControl();

    public <T> T selectUniqueSQLResult(String SQL);

    public void update(String SQL, Map<String, Object> input);
    @Deprecated
    public List<Map<String, Object>> it_construccion();

    public Map<String, Object> get(String SQL);
    @Deprecated
    public List<Map<String, Object>> getFiltroConsulta(String queryw, String criterio);

    //**************EJEMPLOS*************
    public List<Map<String, Object>> getPersona();
    @Deprecated
    public List<Map<String, Object>> getFiltroPersona(String queryw, String criterio);

    public void update(Entity entity, Map<String, Object> objectMap, Entity parent) throws ParseException;
    @Deprecated
    public List<Map<String, Object>> getPrediosMigrados();
    @Deprecated
    public void metadata();
    
    public List<Map<String, Object>> selectSQLMapResult(String SQL);
    
    //public List<Map<String, Object>> selectSQLMapResult(String SQL, String param1);
    
    public List<Map<String, Object>> selectSQLMapResult(String SQL, Map<String, Object> fields);
    
    public void persist(String SQL, Map<String, String> table, Map<String, Object> insertable);
    
    public Map<String, Object> get(String SQL, Object ID);
    
    public List<Map<String, Object>> find(String SQL, Map<String, Object> params);
    @Deprecated
    public List<Map<String, Object>> selectMapSQL(String sql);
    @Deprecated
    public Map<String, Object> getObjectMap(String sql5);

    public boolean existObject(String schema, String entity, String field, Object value);

    public boolean existColumn(String schema, String table, String column);
    
    public void insertActovity(String entity, Object id);
    
    public void updateActovity(String entity, Object id);
    
    public void deleteActovity(String entity, Object id);
    
    public void insertActovity(String schema, String entity, Object id);
    
    public void updateActovity(String schema, String entity, Object id);
    
    public void deleteActovity(String schema, String entity, Object id);

    public void delete(String schema, String entity, Object id);
}
